<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="app" uri="http://www.wanrenhui.com" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
	  <%@include file="/res/include/base-head.jsp"%>
	  <%@include file="/res/include/jquery-easyui.jsp"%>
	<script type="text/javascript" src="${pageContext.request.contextPath}/res/js/draw/drawBatch.js"></script>
  </head>
  <body>
	<div class="easyui-layout" data-options="fit:true">
	    <div data-options="region:'center',border:false">
		    <table id="datagrid" data-options="url:'${pageContext.request.contextPath}/draw/batch/list',toolbar:'#toolbar'">
				<thead>
					<tr>
						<th data-options="field:'drawBaseName',width:80,align:'center'">抽奖活动名称</th>
						<th data-options="field:'drawItemName',width:80,align:'center'">奖品名称</th>
						<th data-options="field:'drawItemImg',width:150,formatter:formatImg">图片</th>
						<th data-options="field:'quantity',width:80,align:'center'">数量</th>
						<th data-options="field:'rate',width:120,align:'center' ">中奖率</th>
						<th data-options="field:'strNewAt',width:120,align:'center' ">创建时间</th>
						<th data-options="field:'id',align:'center',width:150,formatter:formatOperation">管理操作</th>
					</tr>
				</thead>
			</table>
	  	</div>
	</div>
	<script>
	function formatImg(drawItemImg){
        return '<img style="width:60px;height:60px;" src="'+drawItemImg+'"/>'
    }
	function formatOperation(value,row,index) {
		var l_html = '';
		l_html += '<a href="javascript:;" class="table_link" onclick="admin.drawBatch.toUpdate('+row.id+')">编辑</a>';
		return l_html;
	}
	</script>
  </body>
</html>
